Skip to content

Add missing position to pattern constructors #5953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nicolasstucki
Copy link
Contributor

Detected the missing positions in #5846 (7a07485)

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


def copy(original: TypeTest)(tpt: TypeTree)(implicit ctx: Context): TypeTest =
tpd.cpy.Typed(original)(untpd.Ident(nme.WILDCARD).withType(tpt.tpe), tpt)
tpd.cpy.Typed(original)(untpd.Ident(nme.WILDCARD).withSpan(original.span).withType(tpt.tpe), tpt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be an argument that we should disregard TypeTrees in TastyReflect -- they are not reliable, macros should always depend on types instead of type trees.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the trees for positions. And this is not a type tree, it is the pattern _: T of a case _: T =>

@nicolasstucki nicolasstucki merged commit 60c4bf8 into scala:master Feb 20, 2019
@ghost ghost removed the stat:needs review label Feb 20, 2019
@nicolasstucki nicolasstucki deleted the add-missing-pattern-positions branch February 20, 2019 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants